package cn.tedu.smartos.family_user.mapper;

import cn.tedu.smartos.family_user.pojo.entity.ElectronicFence;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ElectronicFenceMapper {
        int insertFence(ElectronicFence fence);
        int updateFence(ElectronicFence fence);
        int deleteFence(Long fenceId);
        List<ElectronicFence> selectFencesByElderly(Long elderlyUserId);
        List<ElectronicFence> selectActiveFences(Long elderlyUserId);
        int updateFenceStatus(@Param("fenceId") Long fenceId,
                              @Param("lastStatus") Integer lastStatus);
        // 新增：按家属查询围栏
        ElectronicFence selectFenceById(Long fenceId);
        List<ElectronicFence> selectFencesByFamily(Long familyUserId);


    }
